<template>
   <div>
     <router-link :to="{name:pathname,params:{storeCode:jsminfo.storeCode,status:selectIndex}}" class="jms-item">
      <!--  <p class="name" :class="[jmsStateClass]">{{jsminfo.storeName}} </p> -->
      <div class="l1">
        <span class="filed">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</span>
        <span  class="value">{{jsminfo.name}}</span>
      </div>
      <div class="l1">
        <span class="filed">联系电话:</span>
        <span  class="value">{{jsminfo.mobile}}</span>
      </div>
      <div class="l1">
        <span class="filed">详细地址:</span>
        <span  class="value">
           {{jsminfo.address}}
          </span>
      </div>
      <div class="l1">
        <span class="filed">提交时间:</span>
        <span  class="value">{{jsminfo.gmtCreate}}</span>
      </div>
      <!--  <p class="site">{{jsminfo.address}}</p>
       <p class="dz-name">{{jsminfo.name}}</p>
       <p class="tel">{{jsminfo.managerMobile}}</p>
       <p class="qy-time">提交时间：{{jsminfo.gmtCreate | splitTime}}</p> -->
       <div v-show="jmsflag=='yxjms'">
         <div class="feeStatus" :class="jmsStateClass" v-show="selectIndex==''">{{formateAllStatus(jsminfo.gatherStatus)}}</div>
         <div class="feeStatus" :class="jmsStateClass"  v-show="selectIndex==1">{{"待缴费 "+agentStatusArr[jsminfo.intentLevel-1].name}}</div>
         <div class="feeStatus" :class="jmsStateClass"  v-show="selectIndex==2"  >{{formateFeeStatus(jsminfo.gatherStatus)}}</div>
         <div class="feeStatus" :class="jmsStateClass"  v-show="selectIndex==3">{{qyStatusArr[jsminfo.signStatus-1].name }}</div>
          <!-- <div class="feeStatus" :class="jmsStateClass"  v-show="selectIndex==3">{{jsminfo.signStatus}} </div>   -->
       </div>
       <div  v-show="jmsflag=='jms'">
          <div class="feeStatus"  :class="jmsStateClass"   >{{jmstypeName[jsminfo.openStatus-1]}}</div>
          <!-- <div class="feeStatus jms1"    v-show="selectIndex==1">已开业</div>
          <div class="feeStatus jms2"    v-show="selectIndex==2">待开业</div> -->
       </div> 
     </router-link>
   
   </div>
</template>

<script>
import Vue from "vue";
    export default{
        props:{
          jsminfo:{
                type: Object,
                default: {},
                required: true
            },
          jmsflag: {
              type: String,
              default: 'jms',
              required: true
          },
          selectIndex: {
              type: String,
              default:1,
              required: true
          }
        },
        data(){
            return {
              agentStatusArr:[],
              jfStatusArr:[],
              qyStatusArr:[],
              yyStatusArr:[],
              jmstypeName:['已开业','待开业'],

            }
        },
        components: {},
        methods: {
          getDic(){
            let vm=this;  
            var data=this.getStatus(10033);
		          	data.then(function(value){
                vm.agentStatusArr=value;
                	},function(err){
				         console.log(err);
                })
            var readyNum=10013;
            var data=this.getStatus(10013);
		      	data.then(function(value){
              vm.jfStatusArr=value;
             	})
             var data=this.getStatus(10042);
		      	data.then(function(value){
              vm.yyStatusArr=value;
            	})
             var data=this.getStatus(10039);
		      	data.then(function(value){
              vm.qyStatusArr=value;
              
           	})
           
          }, 
          formateAllStatus(fee){
            if(fee==3){
               
              
               return this.yyStatusArr[this.jsminfo.checkStatus-1].name;
               
            }else{
              return this.jfStatusArr[fee-1].name;
              
            }
            
          },
          formateFeeStatus(fee){
            if(fee==3){
               return this.yyStatusArr[this.jsminfo.checkStatus-1].name;
            }else{
              return this.jfStatusArr[fee-1].name;
            }
              
          },
        },
        mounted(){
         
       
        },
        created(){
          this.getDic();
        },
        computed: {
          
          jmsStateClass () {
             // 加盟商 开店 状态
            if(this.jmsflag == 'jms'){
          
              return "jms"+this.jsminfo.openStatus;
                
            }else{
             var wish= this.jsminfo.gatherStatus;
               if(this.selectIndex==3){
                 var wish=this.jsminfo.signStatus;
             }else if(this.selectIndex==1){
               var wish=this.jsminfo.intentLevel;
               return 'typeIcon' + 1;
              }else if(this.selectIndex==2){
               var wish= this.jsminfo.gatherStatus;
              }
              return 'typeIcon' + wish
            }
          },
          pathname () {
              // 要跳转的页面
            if(this.jmsflag == 'jms'){
              return 'jmsinfo'
            }else{
              return 'yxjmsinfo'
            }
          }
        },
        filters: {
            splitTime (v) {
              if(!v) return ''
              v = v.toString()
              return v.split(' ')[0]
            }
        }

    }
</script>
<style lang="less" scoped>
.feeStatus{
   position:absolute;
   display: inline-block;
   top:.17rem;
   right:0px;
   font-size:0.23rem;
   padding:0 10px 0 20px;
   height: .5rem;
   line-height:.53rem;
   color:#fff;
   background-size: 100% 100%; 
   text-indent:10px;
}
.typeIcon1{
     background: url(../assets/images/myc/type2.png) no-repeat 0;
}
.typeIcon2{
     background: url(../assets/images/myc/type2.png) no-repeat 0;
}
 .typeIcon3{
     background: url(../assets/images/myc/type2.png) no-repeat 0;
}
.typeIcon4{
     background: url(../assets/images/myc/type3.png) no-repeat 0;
}
.jms2{
     background: url(../assets/images/myc/typeIcon5.png) no-repeat 0;
}
.jms1{
     background: url(../assets/images/myc/typeIcon6.png) no-repeat 0;
}
.l1{
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;
}
.l1>span{
  font-size: .3rem;
   
   
  line-height: .65rem;
}
.l1 .filed{
  letter-spacing: 2px;
  display: inline-block;
  flex:2;
 color: #666666;
}
 .l1 .value{
  display: inline-block;
  flex:6;
  padding-right:20px;
  color: #222222;
}
.l1:nth-child(3) .value{
    overflow: hidden;
  -ms-text-overflow: ;
  text-overflow: ellipsis;
  white-space: nowrap;
} 
 
</style>

